#define D2D_INPUT_COUNT 1
#define D2D_INPUT1_SAMPLEX

//hlsl帮助程序库
#include "d2d1effecthelpers.hlsli"

D2D_PS_ENTRY(main){
    //获取当前像素在屏幕上的坐标（相对位置）
    float2 pos = D2DGetInputCoordinate(0).xy;
    pos = float2(pos.x-0.5, 0.5-pos.y);
    float theta = atan2(pos.y,pos.x);
    if(pos.y<=0)
    theta = theta+2*3.1415;
    float r1 = pos.y/sin(theta);
    float x = theta/(2*3.1415);
    float y = r1/0.5;
    //按百分比进行采样
    return D2DSampleInput(0,float2(x,y));
}